<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>

<!--<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">-->
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
 
  <head>
    <title>注册用户</title>
    <link href="<%=basePath%>resources/css/stylesMonitor.css" type=text/css rel=stylesheet>
    <script type="text/javascript" src="<%=basePath%>resources/scripts/prototype.js"></script>
    <script type="text/javascript" src="<%=basePath%>resources/scripts/My97DatePicker/WdatePicker.js"></script>
   	<meta http-equiv="pragma" content="no-cache">
	<meta http-equiv="cache-control" content="no-cache">
	<meta http-equiv="expires" content="0">    
	<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
	<meta http-equiv="description" content="This is my page">
	<!--
	<link rel="stylesheet" type="text/css" href="styles.css">
	-->
<style type="text/css">
* {
	font-size: 15px;
	font-family: 微软雅黑;
}

td {
	color: #587b94;
}


.Label1 {
	font-family: 微软雅黑;
	background: #f2f7fc;
	padding: 3px 8px 3px 3px;
	font-size: 16px;
	text-align: right;
	height: 60px;
	width: 15%;
}

.EditTableHeader input:first-child {
	background: #32b5ca;
}

.ContentTable {
	width: 100%;
	font-size: 12px;
	background: #FCF5F5;
	border-spacing: 1px;
	
}

.ContentTable td {
	width: 100%;
	font-size: 14px;
	background: white;
	border-spacing: 1px;
	text-align: center;
}

.EditTableHeader {
	color: #32b5ca;
	background: #ecf4f7;
	font-size: 20px;
	font-weight: normal;
	text-align: center;
	height: 60px;
	padding: 4px;
}

input {
	width: 250px;
	height: 40px;
	border: 0px solid #e2ebf0;
	color: #587b94;
	outline: none;
	border-bottom:1px solid #e2ebf0;
}

select {
	width: 250px;
	height: 40px;
	border: 1px solid #e2ebf0;
	color: #587b94;
}

#submit {
	height: 60px;
	line-height: 60px;
	background: url("../resources/images/monitorSystem/submit.png")
		no-repeat;
	border-style: none;
	outline: none;
	width: 190px;
	margin-top: 5px;
 	margin-right: 50px; 
}

#submit:HOVER {
	height: 60px;
	line-height: 60px;
	background: url("../resources/images/monitorSystem/submit_focus.png")
		no-repeat;
	border-style: none;
	outline: none;
	width: 190px;
	margin-top: 5px;
 	margin-right: 50px;
}

#reset {
	height: 60px;
	line-height: 60px;
	background: url("../resources/images/monitorSystem/reset.png") no-repeat;
	border-style: none;
	outline: none;
	width: 190px;
	margin-top: 5px;
 	margin-left: 50px;
}

#reset:HOVER {
	height: 60px;
	line-height: 60px;
	background: url("../resources/images/monitorSystem/reset_focus.png")
		no-repeat;
	border-style: none;
	outline: none;
	width: 190px;
	margin-top: 5px;
    margin-left: 50px;
}
</style>
<script type="text/javascript">
  	function checkForm(){
  		var oForm = document.forms[0];
  		
  		if(oForm.hostLocation.value.length==0){
  			alert("请选择服务器所属区域");
  			return false;
  		}
  		
  		if(oForm.departmentId.value.length==0){
  			alert("请选择部门名称");
  			return false;
  		}
  		
  		if(oForm.dataLevelId.value.length==0){
  			alert("请选择数据级别");
  			return false;
  		}
  		
  		if(oForm.hostTypeId.value.length==0){
  			alert("请选择类型");
  			return false;
  		}
  		if(oForm.name.value.length==0){
  			alert("机器名不能为空");
  			return false;
  		}
  		if(oForm.name.value.length>100){
  			alert("机器名长度不能大于100");
  			return false;
  		}
  		if(oForm.address.value.length==0){
  			alert("存放地址不能空");
  			return false;
  		}
  		if(oForm.address.value.length>200){
  			alert("存放地址长度不能大于200");
  			return false;
  		}
  		if(oForm.ip.value.length==0&&oForm.ipInNet.value.length==0){
  			alert("外网ip和内网ip不能都为空");
  			return false;
  		}
  		if(oForm.ip.value.length>50){
  			alert("外网ip长度不能大于50");
  			return false;
  		}
  		if(oForm.ipInNet.value.length>50){
  			alert("内网ip长度不能大于50");
  			return false;
  		}
  		return true;
  	}
  </script>
  </head>

  <body>
   <div class="ContentContainer">
 <div id="divListContainer">
 <form action="<%=basePath%>host/add" method="post" onsubmit="return checkForm()">
  <div >
  	<div >
        <table   class="ContentTable" style="width:1042px;margin-top: 25px;border: 1px solid #EEEEEE" align="center">
         
          <tr align="center">
            <td class="EditTableHeader" width="600px" align="center" height="80px" colspan="4" style="font-size: 20px;color: rgb(39, 65, 86);background-color: rgb(236, 244, 247)">新增主机</td>
          </tr>
          
         <tr align="center">
            <td  class="Label1" width="200px" align="right" height="40px">服务器所属区域：&nbsp;&nbsp;</td>
            <td class="Field1" align="left" colspan="3" style="text-align: left;">
            	<select style="width: 230px;height: 40px" name="hostLocation">
            		<option value="">请选择</option>
				    <option value="0">本地服务器</option>
				    <option value="1">广州服务器</option>
				    <option value="2">佛山服务器</option>
				</select>
				<font color="#ff0000"><span>*</span></font><font color="#ff00ff"><span id="mes"></span></font>
            </td>
          </tr>
          
          
          <tr align="center">
            <td  class="Label1" width="200px" align="right" height="40px">所属部门：&nbsp;&nbsp;</td>
            <td class="Field1" width=400px align="left" >
            	<select name="departmentId" style="width: 230px;height: 40px">
            		<option value="">请选择</option>
				     <c:forEach items="${departmentList}" var="department">   
				     	<option value=${department.id}>${department.departmentName}</option>
   					 </c:forEach>
				</select>
				<font color="#ff0000"><span>*</span></font><font color="#ff00ff"><span id="mes"></span></font>
            </td>
            <td  class="Label1" width="200px" align="right" height="40px">数据级别：&nbsp;&nbsp;</td>
            <td class="Field1" width=400px align="left" >
            	<select name="dataLevelId" style="width: 230px;height: 40px">
            		<option value="">请选择</option>
				     <c:forEach items="${dataLevelList}" var="dataLevel">   
				     	 <option value=${dataLevel.id}>${dataLevel.levelName}</option>
   					 </c:forEach>
				</select>
				<font color="#ff0000"><span>*</span></font><font color="#ff00ff"><span id="mes"></span></font>
            </td>
          </tr>
          
          
     	 <tr align="center">
            <td  class="Label1" width="200px" align="right" height="40px">类型：&nbsp;&nbsp;</td>
            <td class="Field1" width=400px align="left" >
            	<select name="hostTypeId" style="width: 230px;height: 40px">
            		<option value="">请选择</option>
				     <c:forEach items="${hostTypeList}" var="hostType">   
				     	<option value=${hostType.id}>${hostType.name}</option>
   					 </c:forEach>
				</select>
				<font color="#ff0000"><span>*</span></font><font color="#ff00ff"><span id="mes"></span></font>
            </td>
            <td class="Label1" width="200px" align="right" height="40px">机器名：&nbsp;&nbsp;</td>
            <td  class="Field1" width=400px align="left" >
            	<input type="text" size="30" name="name" style="width: 230px;height: 40px">
				  <font color="#ff0000"><span>*</span></font>
            </td>
             
          </tr>
          
        
          <tr align="center">
            <td  class="Label1" width="200px" align="right" height="40px">存放地址：&nbsp;&nbsp;</td>
            <td class="Field1" width=400px align="left" >
            	<input type="text" size="30" name="address" style="width: 230px;height: 40px">
				  <font color="#ff0000"><span>*</span></font>
            </td>
            <td class="Label1" width="200px" align="right" height="40px">运营商：&nbsp;&nbsp;</td>
            <td class="Field1" width=400px align="left" >
            	<input type="text" size="30" name="telecom" style="width: 230px;height: 40px">
            </td>
          </tr>
         
          <tr align="center">
            <td  class="Label1" width="200px" align="right" height="40px">外网ip地址：&nbsp;&nbsp;</td>
            <td class="Field1" width=400px align="left" >
            	<input type="text" size="30" name="ip" style="width: 230px;height: 40px">
            </td>
            
            <td  class="Label1" width="200px" align="right" height="40px">内网ip地址：&nbsp;&nbsp;</td>
            <td class="Field1" width=400px align="left" >
            	<input type="text" size="30" name="ipInNet" style="width: 230px;height: 40px">
            </td>
             
          </tr>
          
          <tr align="center">
            <td   class="Label1" width="200px" align="right" height="40px">操作系统：&nbsp;&nbsp;</td>
            <td  class="Field1" width=400px align="left" >
            	<input type="text" size="30" name="operatingSystem" style="width: 230px;height: 40px">
            </td>
            
            <td  class="Label1" width="200px" align="right" height="40px">登陆端口号：&nbsp;&nbsp;</td>
            <td  class="Field1" width=400px align="left" >
            	<input type="text" size="30" name="remotePoint" style="width: 230px;height: 40px">
            </td>
          </tr>
          
          <tr align="center">
            <td  class="Label1" width="200px" align="right" height="40px">登陆用户名：&nbsp;&nbsp;</td>
            <td class="Field1" width=400px align="left" >
            	<input type="text" size="30" name="loginName" style="width: 230px;height: 40px">
            </td>
            <td  class="Label1" width="200px" align="right" height="40px">登陆密码：&nbsp;&nbsp;</td>
            <td  class="Field1"width=400px align="left" >
            	<input type="text" size="30" name="loginPwd" style="width: 230px;height: 40px">
            </td>
          </tr>
          <tr align="center">
            <td class="Label1" width="200px" align="right" height="40px">备注：&nbsp;&nbsp;</td>
            <td class="Field1"width=400px align="left"  colspan="3">
           	 <textarea rows="6" cols="107" name="remark" style="border:1px solid #e2ebf0"></textarea>
            </td>
          </tr>
               <tr align="center">
            <td  colspan="4"  align="center" >
           		<input type="submit" name="button2"  value="" id="submit">
				<input type="reset" value="" id="reset">
            </td>
          </tr>
      </table>
      
<!--      <p align="center">-->
<!--		<input type="submit" name="button2"  value="提交" style="width=60px" >&nbsp;&nbsp;&nbsp;-->
<!--		&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;-->
<!--		<input type="reset" value="重写" style="width=60px">-->
<!--		</p>-->
    </div>
  </div>
  </form>
  </div>
  </div>
</body>

</html>
